From fdfab2e9e39d2a1ff8f294a131074899cb7f10de Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Mon, 16 Jan 2006 17:50:18 +0000 Subject: [PATCH] (unrmail): Use regular expression search to find message separators such that the fake separators inserted by rmime.el are not matched. The sections added by rmime.el are removed. --- lisp/mail/unrmail.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el index d1e95a41244..a4ba36622eb 100644 --- a/lisp/mail/unrmail.el +++ b/lisp/mail/unrmail.el @@ -108,11 +108,12 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (from-buffer (current-buffer))) ;; Process the messages one by one. - (while (search-forward "\^_\^l" nil t) + (while (re-search-forward "^\^_\^l" nil t) (let ((beg (point)) (end (save-excursion - (if (search-forward "\^_" nil t) - (1- (point)) (point-max)))) + (if (re-search-forward "^\^_\\(\^l\\|\\'\\)" nil t) + (match-beginning 0) + (point-max)))) (coding 'raw-text) label-line attrs keywords mail-from reformatted) @@ -173,6 +174,12 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (re-search-forward "^[*][*][*] EOOH [*][*][*]\n") (delete-region (point-min) (point))) + ;; Handle rmime formatting. + (when (require 'rmime nil t) + (let ((start (point))) + (while (search-forward rmime-magic-string nil t)) + (delete-region start (point)))) + ;; Some operations on the message header itself. (goto-char (point-min)) (save-restriction -- 2.30.2